package com.share.device.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.share.device.domain.WorkOrder;
import com.share.device.domain.dto.WorkOrderDto;
import com.share.device.domain.vo.WorkOrderVo;
import com.share.device.mapper.WorkOrderMapper;
import com.share.device.service.WorkOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder> implements WorkOrderService {
    @Autowired
    private WorkOrderMapper workOrderMapper;


    //工单列表
    @Override
    public PageInfo<WorkOrderVo> workOrderList(WorkOrderDto workOrderDto) {
        PageHelper.startPage(workOrderDto.getPageNum(), workOrderDto.getPageSize());
        List<WorkOrderVo> list = workOrderMapper.workOrderList(workOrderDto);
        PageInfo<WorkOrderVo> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }

    //查看详情
    @Override
    public WorkOrderVo getWorkOrderDetail(Integer id) {
        WorkOrderVo workOrderVo = workOrderMapper.getWorkOrderDetail(id);
        return workOrderVo;
    }


}
